Fix #305740: avoid sync subprocess wait in TS node path resolution - #305752
Fix #305740: avoid sync subprocess wait in TS node path resolution#305752rupeshkumar-555 wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses host responsiveness issues in the TypeScript extension by removing synchronous subprocess probing (execFileSync) from Node path detection and replacing it with PATH-based executable resolution.
Changes:
- Added
resolveNodeExecutableFromPathto resolvenodeviaPATH/PATHEXTinstead of running a subprocess. - Updated
findNodePathto use the new resolver and keep the existing warning behavior when Node cannot be detected. - Added unit tests covering PATH resolution on win32 and non-win32.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| extensions/typescript-language-features/src/configuration/configuration.electron.ts | Replaces sync subprocess detection with PATH-based resolution helper used by Node path detection. |
| extensions/typescript-language-features/src/test/unit/configuration.electron.test.ts | Adds unit coverage for the new PATH-based Node resolution behavior. |
|
@microsoft-github-policy-service agree |
9ef3f05 to
22ff881
Compare
|
Addressed the remaining Copilot review issue in PR #305752:
Validation run:pm run test-node -- --grep typescript.configuration.electron ✅ Notes on environment:
|
|
Re-verified this PR after syncing latest branch changes. What is now confirmed:
Current PR gate status:
No failing CI checks remain from this fix. |
|
TylerLeonhardt Ready for review/merge.\n\nThis PR has been re-verified and all required checks are passing (Dependencies Check, license/cla). Remaining gate is maintainer approval (REVIEW_REQUIRED / Community PR Approvals).\n\nCould you please review and approve when you have a moment? |
|
This setting is used by a very small percentage of users and the linked original issue doesn't seem to mention it? Without more evidence this doesn't seem like the root cause |
Problem
Issue #305740 reports host unresponsiveness when a subprocess wait blocks an event-loop owned path.
In TypeScript extension configuration, resolving the user-configured node path used a synchronous subprocess call:
Even with a timeout, this can still block the extension host event loop during stalls and degrade responsiveness.
Fix
Replaced synchronous subprocess probing with direct PATH-based executable resolution:
This keeps node path resolution fully non-blocking from the event-loop perspective.
Tests
Fixes #305740